<!DOCTYPE html>
<?php
$source = file_get_contents ( __DIR__ . '/myfirst.tpl' );
?>
<html>
<head>
<meta charset="UTF-8">
<title>はじめの一歩</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="../ckeditor.js"></script>
<script type="text/javascript">
$(function() {
//	alert('god');
	$("#button-preview").click(function(){
//		alert('now');
//		preview = '';
		$("#preview").load("mypreview.php",{editor1:$('#editor1').val()});
	});
});
</script>
</head>
<body>
	<form name="cpedit">
		<textarea id="editor1" name="editor1" rows="10" cols="80">
			<?php echo $source;?>
		</textarea>
		<script>
		// Replace the <textarea id="editor1"> with a CKEditor
		// instance, using default configuration.
			CKEDITOR.replace( 'editor1' );
		</script>
		<div><input type="button" value="preview" id="button-preview" /></div>
	</form>
	<!-- プレビューブロック -->
	<hr />
	<div id="preview"></div>
	<!-- /プレビューブロック -->
</body>
</html>